import React, { useContext } from "react";
import classes from "./Navbar.module.css";
import backSvg from "../../assets/svg/back.svg";
import { useNavigate } from "react-router-dom";
import ThemeContext from "../../store/themeContext";
export default function Navbar({ linkName }) {
    const ctx = useContext(ThemeContext);
    const navigate = useNavigate();
    const pageBack = () => {
        navigate(-1);
    };
    return (
        <div className={classes.headerTop} style={{ color: ctx.theme === "light" ? "#2f2f2f" : "#fff" }}>
            <div onClick={pageBack}>
                <img style={{ filter: ctx.theme === "light" ? "drop-shadow(rgb(0, 0, 0) 100rem 0)" : "drop-shadow(rgb(255, 255, 255) 100rem 0)" }} src={backSvg} alt="backSvg" />
            </div>

            <div>{linkName}</div>
            <div className={classes.box} style={{ backgroundColor: ctx.theme === "light" ? "#dedfef" : "#2f2f2f" }}></div>
        </div>
    );
}
